home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu / headers.arc / 6HC705C8.05H < prev    next >
Text File  |  1989-09-21  |  10KB  |  200 lines

  1. /*
  2.                      MC68HC705C8  HEADER
  3.  
  4. WRITTEN:    9/21/89
  5. REVISION:   0.9
  6. USE FOR:    MC68HC705C8S | MC68HC705C8P (OTP)
  7.  
  8. The following header describes the memory, vectors, peripherals and special
  9. instructions for the MC68HC705C8 microprocessor.  The information is taken from
  10. the Motorola Data Sheet and is assumed to be correct.  It is specifically
  11. designed to work with the Byte Craft C6805 Compiler, and is offered free for
  12. your convenience.
  13.  
  14. I have taken most of the mnemonics directly from the Motorola literature with
  15. the exception of those labels which could cause confusion with the compiler
  16. or the assembler.  Please check all labels before using.
  17.  
  18. If you discover any errors or omissions, please communicate them to me through
  19. the FREEWARE bulletin board or directly at the Motorola Detroit Sales Office
  20. (313) 347-6800 (Before 10/15/89: 261-6200).
  21.  
  22. Mike Pauwels,  Senior FAE
  23.  
  24. ******************************************************************************
  25. *                                                                            *
  26. * This product is distributed without charge to users via the MOTOROLA       *
  27. * FREEWARE Bulletin Board.  The product is provided "as is" without warranty *
  28. * of any kind either expressed or implied, including, but not limited to any *
  29. * warranties of merchantability and fitness for a particular purpose.  All   *
  30. * risks of using this product including the entire costs of any necessary    *
  31. * remedies are those of the user and MOTOROLA assumes no liability of any    *
  32. * kind.                                                                      *
  33. *                                                                            *
  34. ******************************************************************************
  35.  
  36. */
  37.  
  38.  
  39. /*                   MEMORY MAP                                              */
  40.  
  41. /* NOTE:
  42.    Bits in the option register can be #defined in the main file before the
  43.    #include of this file; #else they will default.                           */
  44.  
  45. #ifdef ram0
  46. #else
  47. #define ram0 0                  /* change to 0x80 for 'C4 emulation          */
  48. #endif
  49. #ifdef ram1
  50. #else
  51. #define ram1 0                  /* change to 0x40 for 'C4 emulation          */
  52. #endif
  53. #ifdef secur
  54. #else
  55. #define secur 0                 /* change to 0x08 to enable security         */
  56. #endif
  57. #ifdef irqro
  58. #else
  59. #define irqro 0                 /* change to 0x02 for edge-triggered only IRQ*/
  60.  
  61. #pragma mor @ 0x1fdf = 0x80&ram0 | 0x50&ram1 | 0x8&secur | 0x2&irqro
  62.  
  63. #if ram0
  64. #pragma memory RAMPAGE0 [208]   @ 0x0030 ;
  65. #else                                         /* ram0 = 0                    */
  66. #pragma memory ROMPAGE0 [48]    @ 0x0020 ;
  67. #pragma memory RAMPAGE0 [176]   @ 0x0050 ;
  68. #endif
  69. #if ram1
  70. #pragma memory RAMPROG  [96]    @ 0x0100 ;
  71. #pragma memory ROMPROG  [7584]  @ 0x0160 ;
  72. #else                                        /* ram1 = 0                     */
  73. #pragma memory ROMPAGE1 [7680]  @ 0x0100 ;
  74.  
  75.  
  76.  
  77. /*                   INTERRUPT VECTORS                                       */
  78.  
  79. #pragma vector __RESET @ 0x1ffe ;
  80. #pragma vector SWI     @ 0x1ffc ;
  81. #pragma vector IRQ     @ 0x1ffa ;
  82. #pragma vector TIMER   @ 0x1ff8 ;
  83. #pragma vector SCI     @ 0x1ff6 ;
  84. #pragma vector SPI     @ 0x1ff4 ;
  85.  
  86.  
  87. /*                   INPUT/ OUTPUT PORTS                                     */
  88.  
  89. #pragma portrw porta   @ 0x00;  /* General Purpose I/O Port                  */
  90. #pragma portrw portb   @ 0x01;  /* General Purpose I/O Port                  */
  91. #pragma portrw portc   @ 0x02;  /* General Purpose I/O Port                  */
  92. #pragma portr  portd   @ 0x03;  /* in  ,-    ,SS   ,SCK  ,MOSI ,MISO,TxD,RxD */
  93. #pragma portrw ddra    @ 0x04;  /* Data direction, Port A                    */
  94. #pragma portrw ddrb    @ 0x05;  /* Data direction, Port B                    */
  95. #pragma portrw ddrc    @ 0x06;  /* Data direction, Port C                    */
  96.  
  97.  
  98. /*        SERIAL PERIPHERAL INTERFACE REGISTERS                              */
  99.  
  100. #pragma portrw spcr    @ 0x0A;  /* SPIE,SPE,-,MSTR,CPOL,CPHA,SPR1,SPR0       */
  101. #define spie   7                /* Serial Peripheral Interrupt Enable        */
  102. #define spe    6                /* Serial Peripheral Enable                  */
  103. #define master 4                /* Master (= 1) | Slave (= 0)                */
  104. #define cpol   3                /* Clock Polarity                            */
  105. #define cpha   2                /* Clock Phase                               */
  106. #define spr1   1                /* SPI Clock Rate Bit                        */
  107. #define spr0   0                /* SPI Clock Rate Bit                        */
  108.  
  109. #pragma portrw spsr    @ 0x0B;  /* SPIF,WCOL,-,MODF,-,-,-,-                  */
  110. #define spif   7                /* Serial Peripheral Data Transfer Flag      */
  111. #define wcol   6                /* Write Collision                           */
  112. #define modf   4                /* Mode Fault                                */
  113.  
  114. #pragma portrw spdr    @ 0x0C;  /* SPI Data                                  */
  115.  
  116.  
  117. /*      SERIAL COMMUNICATIONS INTERFACE REGISTERS                            */
  118.  
  119. #pragma portw baud     @ 0x0D;  /* -,-,SCP1,SCP0;-,SCR2,SCR1,SCR0            */
  120. #define baud9600 0x30           /* 9600 Baud; Assumes 4.0 MHz Xtal           */
  121. #define baud1200 0x33           /* 1200 Baud; Assumes 4.0 MHz Xtal           */
  122. #define baud8192 0x22           /* 8192 Baud; Assumes 4.1943 MHz Xtal        */
  123.                          /* Other Baud Rates: See MicroProcessor Data Sheet  */
  124.  
  125. #pragma portw  sccr1   @ 0x0E;  /* R8,T8,-,M;WAKE,-,-,-                      */
  126. #define r8     7                /* Recieve Data Bit 8                        */
  127. #define t8     6                /* Transmit Data Bit 8                       */
  128. #define m      4                /* SCI Character Word Length                 */
  129. #define wake   3                /* Wake Up Select                            */
  130.  
  131. #pragma portw  sccr2   @ 0x0F;  /* TIE,TCIE,RIE,ILIE;TE,RE,RWU,SBK           */
  132. #define tie  7                  /* Transmit Interrput Enable                 */
  133. #define tcie 6                  /* Transmit Complete Interrupt Enable        */
  134. #define rie  5                  /* Receive Interrupt Enable                  */
  135. #define ilie 4                  /* Idle Line Interrupt Enable                */
  136. #define te   3                  /* Transmit Enable                           */
  137. #define re   2                  /* Receive Enable                            */
  138. #define rwu  1                  /* Receiver Wake-Up                          */
  139. #define sbk  0                  /* Send Break                                */
  140.  
  141. #pragma portr  scsr    @ 0x10;  /* TDRE,TC,RDRF,IDLE;OR,NF,FE,-              */
  142. #define tdre   7                /* Transmit Data Register Empty              */
  143. #define tc     6                /* Transmit Complete                         */
  144. #define rdrf   5                /* Receive Data Register Full                */
  145. #define idle   4                /* Idle Line Flag                            */
  146. #define or     3                /* Overrun Flag                              */
  147. #define nf     2                /* Noise Flag                                */
  148. #define fe     1                /* Framing Error                             */
  149.  
  150. #pragma portrw scdat   @ 0x11;  /* SCI Data                                  */
  151. #pragma portr  rdr     @ 0x11;  /* SCI Receive Data (same as scdat)          */
  152. #pragma portw  tdr     @ 0x11;  /* SCI Transmit Data (same as scdat)         */
  153.  
  154.  
  155. /*                    TIMER REGISTERS                                        */
  156.  
  157. #pragma portrw tcr     @ 0x12;  /* ICIE,OCIE,TOIE,0;0,0,IEGE,OLVL            */
  158. #define icie   7                /* Input Capture Interrupt Enable            */
  159. #define ocie   6                /* Output Compare Interrupt Enable           */
  160. #define toie   5                /* Timer Overflow Interrupt Enable           */
  161. #define iege   1                /* Input Edge                                */
  162. #define olvl   0                /* Output Level                              */
  163.  
  164. #pragma portr  tsr     @ 0x13;  /* ICF,OCF,TOF,0; 0,0,0,0                    */
  165. #define icf    7                /* Input Capture Flag                        */
  166. #define ocf    6                /* Output Compare Flag                       */
  167. #define tof    5                /* Timer Overflow Flag                       */
  168.  
  169. #pragma portr  ichr    @ 0x14;  /* Input Capture Reg High Byte               */
  170. #pragma portr  iclr    @ 0x15;  /* Input Capture Reg Low Byte                */
  171. #pragma portrw ochr    @ 0x16;  /* Output Compare Reg High Byte              */
  172. #pragma portrw oclr    @ 0x17;  /* Output Compare Reg Low Byte               */
  173. #pragma portr  tchr    @ 0x18;  /* Timer Counter Register High Byte          */
  174. #pragma portr  tclr    @ 0x19;  /* Timer Counter Register Low Byte           */
  175. #pragma portr  achr    @ 0x1A;  /* Alternate Count Reg High Byte             */
  176. #pragma portr  aclr    @ 0x1B;  /* Alternate Count Reg Low Byte              */
  177.  
  178. /*                  PROGRAMMING CONTROL                                      */
  179.  
  180. #pragma portw  pr      @ 0x1C   /* 0,0,0,0; 0,LAT,0,PGM                      */
  181. #define lat    2                /* Latch enable                              */
  182. #define pgm    0                /* Program                                   */
  183.  
  184. /*              COMPUTER OPERATING PROPERLY  (COP)                           */
  185.  
  186. #pragma portrw copcr   @ 0x1E   /* 0,0,0,COPF; CME,COPE,CM1,CM0              */
  187. #define copf 4                  /* COP Flag                                  */
  188. #define cop16ms 0xc0            /* Enable COP & Clock Mon.;  Timeout = 16ms  */
  189. #define cop65ms 0xcd            /* Enable COP & Clock Mon.;  Timeout = 65ms  */
  190. #define cop262m 0xce            /* Enable COP & Clock Mon.;  Timeout = 262ms */
  191. #define cop1sec 0xcf            /* Enable COP & Clock Mon.;  Timeout = 1 sec */
  192.  
  193. /*    Assumes 4.0 MHz Xtal.  For other times/ consult User's Manual          */
  194.  
  195. /*                   MC68HC05 INSTRUCTIONS                                   */
  196.  
  197. #pragma has STOP ;
  198. #pragma has WAIT ;
  199. #pragma has MUL ;
  200.